<%@page import="java.math.BigDecimal"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="bit.util.ConnectionContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="reqCharEnc.jsp" %>
<%@ include file="preventCache.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>회원 삭제 처리</title>
<link rel="stylesheet"
	type="text/css"
	href="<%= application.getContextPath() %>/style/main.css" />
</head>
<body>

<%
// parameters
BigDecimal idx = new BigDecimal(request.getParameter("idx"));

// Connection
Connection conn = ConnectionContext.getConnection();
// SQL Query
String sql = "DELETE FROM member_info WHERE idx = ?";
// prepare statement
PreparedStatement pstmt = conn.prepareStatement(sql);

pstmt.setBigDecimal(1, idx);

// execute
int result = pstmt.executeUpdate();

if (result > 0) {
%>
	회원 삭제에 성공하였습니다.
<%
} else {
%>
	회원 삭제에 실패하였습니다.
<%
}
%>
<br/><br/>
<input type="button" value="회원 목록으로 돌아가기" onclick="location.href='members.jsp';" />

</body>
</html>